function showPayForm( id ) {
	var showing = id == 'pc'? 'pc' : 'pt';
	var hidding = showing == 'pc'? 'pt' : 'pc';
	document.getElementById(showing).style.display=('block');
	document.getElementById(hidding).style.display=('none');
}

function showPedidoDetails( ) {
	var pedido = document.getElementById('selectpedido');
	var id = pedido.options[selectpedido.selectedIndex].value;
	var elements = document.getElementsByClassName('div_info_pedidos');
	for( var i = 0; i < elements.length; i++ )
	   elements[i].style.display = 'none';
	document.getElementById(id+'_info').style.display=('block');
}


function showDetails() {
    var reglon = document.getElementById('selectlist');        
    var id = reglon.options[selectlist.selectedIndex].value;
    var elements = document.getElementsByClassName('row');
    for ( var i = 0; i < elements.length; ++i ) {
        elements[i].style.display = "none";
    }

    elements = document.getElementsByClassName(id+'_info');
    var stat_wrapper = 'block';
    if ( elements.length > 0 ) {
	    for ( var i = 0; i < elements.length; ++i ) {
	        elements[i].style.display = "block";
	    }
    } else {
    	stat_wrapper='none';
    }
    document.getElementById('info_wrapper').style.display=stat_wrapper;
}

function savePagoId () {
    var radios = document.getElementsByName('selectedPago');
    for( var i = 0; i < radios.length; i++ ) {
        if ( radios[i].checked ) {
            break;
        }
    }
    document.getElementById('deletePago').value = radios[i].value;  
}

$(document).ready(function(){
	$(".menu_hidden").click(function(event) {		
		event.preventDefault();
		$('li div').addClass('hidden');
		$('ul li').removeClass('active')
		$(this).parent().addClass('active');
		$(this).next('div').toggleClass("hidden");
		
	});
	
	// Ajusta las etiquetas de los formularios a la derecha
	$('table tr').find('th').css('text-align','right');
	
	// Ajusta los botones la centro del table
	$('table tr:last-child').css('text-align','center');
	
	// Carga el datepicker
    $(function() {
        $( "#datepicker" ).datepicker();
    });
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
});